package com.zwb.demo.easyweb.modules.genCode;

import com.zwb.demo.easyweb.common.entity.response.ResultCode;
import lombok.ToString;

/**
 * 响应码
 *
 * @author zwb
 */
@ToString
public enum GenCodeCode implements ResultCode {

    SUCCESS(true, 10000, "操作成功！"),
    FAIL(false, 20000, "操作失败！"),
    SERVER_ERROR(false, 20001, "服务器错误！"),
    TEMPLATE_CONTENTS_NULL(false, 20002, "空的模板内容！"),
    TEMPLATE_ID_NO_EXITS(false, 20003, "不存在的模板id！"),
    TABLE_ID_NO_EXITS(false, 20003, "不存在的表id！"),
    JAVA_FIELD_ID_NO_EXITS(false, 20003, "不存在的java类型id！"),


    ;

    /** 是否成功 */
    boolean success;

    /** 操作代码 */
    int code;

    /** 提示信息 */
    String message;

    GenCodeCode(boolean success, int code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }

    @Override
    public boolean success() {
        return success;
    }

    @Override
    public int code() {
        return code;
    }

    @Override
    public String message() {
        return message;
    }
}
